/* Firefox userChrome.css tweaks ********************************************************/
/* Github: https://github.com/aris-t2/customcssforfx ************************************/
/****************************************************************************************/


:root{
  --sidebar-hover-width: 8px;
  --sidebar-visible-width: 300px;
}

#sidebar-box {
  min-width: var(--sidebar-hover-width) !important;
  width: var(--sidebar-hover-width) !important;
  max-width: var(--sidebar-hover-width) !important;
}

#sidebar-box #sidebar {
  opacity: 0 !important;
  position: absolute !important;
  display: block !important;
}

#sidebar-box:hover {
  min-width: var(--sidebar-visible-width) !important;
  width: var(--sidebar-visible-width) !important;
  max-width: var(--sidebar-visible-width) !important;
}

#sidebar-box:hover #sidebar {
  opacity: 1.0 !important;
}

#sidebar-box #sidebar-header {
  visibility: collapse !important;
}

#sidebar-box:hover #sidebar-header {
  visibility: visible !important;
}

#sidebar-box {
  z-index: 1000 !important;
  position: relative !important;
  opacity: 0 !important;
}

#sidebar-box:hover {
  opacity: 1.0 !important;
}

#sidebar-box:not([positionend="true"]) {
  margin-inline-end: calc(-1 * var(--sidebar-hover-width)) !important;
}

#sidebar-box:not([positionend="true"]):hover {
  margin-inline-end: unset !important;
}

#sidebar-box:not([positionend="true"]) ~ :is(#appcontent,#tabbrowser-tabbox) {
  margin-inline-start: 0 !important;
}

#sidebar-box:not([positionend="true"]):hover ~ :is(#appcontent,#tabbrowser-tabbox) {
  margin-inline-start: calc(-1 * var(--sidebar-visible-width)) !important;
}

#sidebar-box[positionend="true"] {
  margin-inline-start: calc(-1 * var(--sidebar-hover-width)) !important;
}

#sidebar-box[positionend="true"]:hover {
  margin-inline-start: unset !important;
}

#sidebar-box[positionend="true"] ~ :is(#appcontent,#tabbrowser-tabbox) {
  margin-inline-end: 0 !important;
}

#sidebar-box[positionend="true"]:hover ~ :is(#appcontent,#tabbrowser-tabbox) {
  margin-inline-end: calc(-1 * var(--sidebar-visible-width)) !important;
}
